<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:pe="http://primefaces.org/ui/extensions"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <f:loadBundle var="msg" basename="admin"/>
    <style type="text/css">
        #layout-menu_menu {
            z-index: 9997 !important;
        }

        #layout-menu_menu span.ui-menuitem-text {
            margin-left: 2px;
        }
    </style>

    <ul class="nav navbar-nav">
        <li class="dropdown user user-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <pe:gravatar id="userImage" value="nonexisting"/>
                <span class="hidden-xs">#{request.remoteUser}</span>
            </a>
            <ul class="dropdown-menu">
                <li class="user-header">
                    <div class="hidden-xs">
                        <c:choose>
                            <c:when test="#{empty userController.user.avatar}">
                                <img style="border-radius: 50%;height: 70px;width: 70px;"
                                     src="#{request.contextPath}/resources/images/user.png"/>
                            </c:when>
                            <c:otherwise>
                                <img style="border-radius: 50%;height: 70px;width: 70px;"
                                     src="#{userController.user.avatar}"/>
                            </c:otherwise>
                        </c:choose>
                    </div>
                    <p>
                        #{request.remoteUser}
                    </p>
                </li>
                <li class="user-footer">
                    <h:form prependId="false">
                        <div class="pull-left">
                            <p:commandLink styleClass="btn btn-danger" value="#{msg['button.changepass']}"/>
                        </div>
                        <div class="pull-right">
                            <a title="#{msg['button.logout']}" href="#{request.contextPath}/logout">
                                <i class="fa fa-sign-out fa-2x" style="color: black;"/>
                            </a>
                        </div>
                    </h:form>
                </li>
            </ul>
        </li>

        <li>
            <a id="layout-setup" href="#" data-toggle="control-sidebar"><i class="fa fa-gears"/></a>
        </li>
    </ul>

</ui:composition>